home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-03-02 | 3.4 KB | 144 lines | [TEXT/MWPS] |
- {FaceIt 2.2 Demonstration Program}
- {©FaceWare 1989-94. All Rights Reserved.}
- {C1 - run program to see on-line comments}
- program fDemoMP;
-
- {C2}
- uses
- FaceStorMP, FaceProcMP, ToolUtils, OSEvents;
- var
- i, mode: integer;
- oldCount, newCount: longint;
- keys: KeyMap;
- fileName: Str255;
-
- begin
- with fRec do
- begin
- {C3}
- uName := 'fDemo.Rsrc';
- {C4}
- FaceIt(nil, DoInit, 3, 0, 0, 0);
- {C5}
- FaceIt(nil, NewWnd, 1010, 1, 0, 0);
- FaceIt(nil, NewWnd, 1020, 1, 0, 0);
- {C6}
- FaceIt(nil, NewWnd, 1030, 1, 0, 0);
- {C7}
- FaceIt(nil, NewWnd, 1040, 2, 0, 0);
- {C8}
- repeat
- FaceIt(nil, DoLoop, 0, 0, 0, 0);
- {C9}
- case uMenuID of
- {C10}
- 101:
- if (uMenuItem = 1) then
- begin
- uString := concat('Demonstration of the use of FaceIt', chr(13), 'to support program-wide features.');
- FaceIt(nil, ShoStr, 3, 12, 1 + (409 * 65536), 0);
- end;
- {C11}
- 102:
- if (uMenuItem = 6) then
- begin
- FaceIt(nil, GetWVC, 1010, 0, 0, 0);
- FaceIt(nil, SavWnd, 1010, 0, 0, 0);
- FaceIt(nil, GetWVC, 1020, 0, 0, 0);
- FaceIt(nil, SavWnd, 1020, 0, 0, 0);
- FaceIt(nil, GetWVC, 1040, 0, 0, 0);
- FaceIt(nil, SavWnd, 1040, 0, 0, 0);
- end;
- {C12}
- 105, 106, 1030, 1040:
- case uMenuItem of
- 1:
- SysBeep(5);
- 2:
- begin
- SysBeep(5);
- SysBeep(5);
- end;
- 3:
- begin
- SysBeep(5);
- SysBeep(5);
- SysBeep(5);
- end;
- {C13}
- 4:
- begin
- FaceIt(nil, GetCtl, 1030, 0, 1, 4);
- FaceIt(nil, PopMen, 107, cRect.top - 9, cRect.left - 10, 0);
- end;
- {C14}
- 8:
- begin
- {C15}
- FaceIt(nil, ShoAlt, 1010, 0, 1, 1);
- mode := uResult;
- oldCount := 0;
- if (mode > 1) then
- while true do
- begin
- {C16}
- newCount := TickCount;
- if (newCount - oldCount > 180) then
- begin
- SysBeep(5);
- oldCount := newCount;
- end;
- {C17}
- if (mode = 2) then
- if GetNextEvent(-1, fEvent) then
- if (fEvent.what = 5) then
- leave
- else
- FaceIt(nil, DoEvnt, 0, 0, 0, 0);
- {C18}
- if (mode = 3) then
- begin
- GetKeys(keys);
- if BitTst(@keys, 61) and BitTst(@keys, 48) then
- begin
- FlushEvents(62, 0);
- leave;
- end;
- end;
- end;
- end;
- otherwise
- end;
- {C19}
- 1100:
- if (uMenuItem = 2) then
- begin
- if (fActiveWnd = nil) then
- uString := 'No Window'
- else if (fActiveID <> 1200) then
- uString := 'Non-ViewIt Window'
- else if (fActiveResID = 1204) then
- uString := 'Help Window'
- else if (fActiveResID = 1010) then
- uString := 'Editor Window'
- else if (fActiveResID = 1020) then
- uString := 'Clipboard Window'
- else if (fActiveResID = 1030) then
- uString := 'Beeps Window';
- FaceIt(nil, SetItm2, 105, 10, 3, 0);
- end
- {C20}
- else if (uMenuItem = 512) then
- if (uString = 'TEXT') and (uResult = 1) then
- begin
- fileName := uName;
- FaceIt(nil, GetCtl, 1010, 0, 1, 1);
- uName := fileName;
- FaceIt(cControl, 1551, 0, 1, 0, 0); {OpnCTxt}
- end;
- otherwise
- end;
- until false;
-
- end;
- end.